﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SuperMicroWave.Common
{
    public class EventResponseController
    {
        private static EventResponseController _instance;
        public static EventResponseController Instance => _instance ?? (_instance = new EventResponseController());

        private DateTime _lastTime = DateTime.MinValue;

        public bool CanExecute()
        {
            var now = DateTime.Now;
            if (now.Subtract(_lastTime) < TimeSpan.FromSeconds(2))
                return false;

            _lastTime = now;
            return true;
        }
    }
}
